<template>
  <div class="news">
    <div class="new">
      <!-- 新闻详情 -->
      <div class="newDetail">
        <div class="newImg">
          <img :src="'http://157.122.54.189:9083' + userImg" alt="" />
        </div>
        <div class="newDes">
          <!-- 新闻标题 -->
          <div class="newTitle">{{ name }}</div>
          <!-- 新闻日期 -->
          <div class="newData">2020-11-20</div>
        </div>
      </div>
      <!-- 关注 -->
      <div class="attention" @click="$emit('click')">{{ follow }}</div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["name", "userImg", "follow"],
  data() {
    return {};
  },
};
</script>

<style lang="less" scoped>
.news {
  padding: 0 20/360 * 100vw;
  margin-top: 30/360 * 100vw;
  padding-bottom: 20/360 * 100vw;
  border-bottom: 1px solid #ccc;
  .new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .newDetail {
      display: flex;
      align-items: center;
      .newImg {
        margin-right: 10/360 * 100vw;
        width: 40/360 * 100vw;
        height: 40/360 * 100vw;
        border-radius: 20 /360 * 100vw;
        background-color: #ccc;
        overflow: hidden;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .newDes {
        .newTitle {
          font-size: 14/360 * 100vw;
          width: 100/360 * 100vw;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }
        .newData {
          font-size: 12/360 * 100vw;
          color: #928876;
        }
      }
    }
    .attention {
      width: 80/360 * 100vw;
      height: 30 /360 * 100vw;
      line-height: 30 /360 * 100vw;
      font-size: 13 /360 * 100vw;
      background-color: #e1e1e1;
      text-align: center;
      border-radius: 15/360 * 100vw;
    }
  }
}
</style>